#!/bin/bash

PATH=$PATH:/glade/u/home/zarzycki/tstorms/source/trajectory:/glade/u/home/zarzycki/tstorms/source/tstorms
export PATH

rm *.mod
rm *.o
rm *.exe
./compile_it tstorms_drive

export homedir=/glade/u/home/zarzycki
export datadir=/glade/scratch/zarzycki/tctest

for DATA_YEAR in {2004..2004}
do

echo "Starting $DATA_YEAR"

cd $datadir

date

shopt -s nullglob
##for f in /glade/proj3/mich1098/zarzycki/detect_files/$DATA_YEAR/atl_30_x4_refine_nochem.cam.h1.*nc 
for f in /glade/scratch/zarzycki/ncep_data/ncep_2004_sub_flip.nc 
do
	echo "Processing - $f"
        ##$homedir/tstorms/scripts/run_tstorms_general $f $datadir/output
        $homedir/tstorms/scripts/colin_traj $f $datadir/output
done

cd $datadir

#### Move filtered data into output
mv ori_filt output/
mv traj_filt output/

date

done
## END LOOP

